//整数除法1
#include<stdio.h>
#include<math.h>
int main() {
	int div1, div2, x, y, count, tmp, flag, ret;
	scanf("%d%d", &x, &y);
	div1 = abs(x);
	div2 = abs(y);
	flag = 1;
	ret = 0;
	if (x * y < 0)
		flag *= -1;
	while (div1 >= div2) {
		tmp = div2;
		count = 1; 
		while (div1 >= (tmp << 1)) {
			count <<= 1;//2
			tmp <<= 1;//8
		}
		div1 -= tmp;
		ret += count;
	}
	printf("%d\n", ret * flag);
	return 0;
}